import { GeographicTilingScheme} from "cesium"
import { ILayerItem } from "../Common/interfaces"
import { TDT_KEY } from "../Config/SystemConfig"

// 图层ID枚举
export enum LayerIdFlag {
    TDT_IMAGERY_WMTS = "tdt_imagery_wmts",
    TDT_ANNOTATION_WMTS = "tdt_annotation_wmts",
    TDT_VECTOR_WMTS = "tdt_vector_wmts",

    GEOMSON_TEST = "geojsonTest",
    KML_TEST = "kmlTest",
    GLB_TEST = "glbTest",
    MODEL_3DTILES_TEST = "model3dtilesTest",
    CZML_TEST = "czmlTest",

    WMS_IMAGE_TEST = "wms_image_test",
    WMS_SHAPETEST = "wms_shapetest",

    WMTS_IMAGE_TEST = "wmts_image_test",

    XYZ_IMAGE_TEST = "xyz_image_test",


}

//天地图影像配置信息
export const tdtImageLayerInfo: ILayerItem =
{
    id: LayerIdFlag.TDT_IMAGERY_WMTS,
    name: 'tdtImage',
    type: "imagery_wmts",
    url: `http://t{s}.tianditu.gov.cn/img_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=img&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default&format=tiles&tk=` + TDT_KEY,
    subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'],
    layer: "tdtBasicLayer",
    style: "default",
    format: "image/jpeg",
    tileMatrixSetID: "GoogleMapsCompatible",

}

//天地图注记信息
export const tdtAnnotationInfo: ILayerItem =
{
    id: LayerIdFlag.TDT_ANNOTATION_WMTS,
    name: 'tdtAnnotation',
    type: "imagery_wmts",
    url: `http://t{s}.tianditu.gov.cn/cia_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=cia&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default&format=tiles&tk=` + TDT_KEY,
    layer: "tdtAnnotationLayer",
    subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'],
    style: "default",
    format: "image/jpeg",
    tileMatrixSetID: "GoogleMapsCompatible",


}
//天地图矢量地图信息
export const tdtVecLayerInfo: ILayerItem =
{
    id: LayerIdFlag.TDT_VECTOR_WMTS,
    name: 'tdtVec',
    type: "imagery_wmts",
    url: "http://t{s}.tianditu.gov.cn/vec_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=vec&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default&format=tiles&tk=" + TDT_KEY,
    layer: "tdtVecBasicLayer",
    subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'],
    style: "default",
    format: "image/jpeg",
    tileMatrixSetID: "GoogleMapsCompatible",
 
}

//geojson测试数据
export const geojsonTestInfo: ILayerItem = {
    id: LayerIdFlag.GEOMSON_TEST,
    name: "geojsonTest",
    type: "geojson",
    url: "/testdata/line.geojson",
    layer: "geojsonTest"
}
//kml测试数据
export const kmlTestInfo: ILayerItem = {
    id: LayerIdFlag.KML_TEST,
    name: "kmlTest",
    type: "kml",
    url: "/testdata/gdpPerCapita2008.kmz",
    layer: "kmlTest"
}

//glb测试数据
export const glbTestInfo: ILayerItem = {
    id: LayerIdFlag.GLB_TEST,
    name: "glbTest",
    type: "glb",
    url: "/testdata/CesiumMilkTruck.glb",
    layer: "glbTest",
    scale: 5,
    lon: 114.314521,
    lat: 22.543062,
    height: 0,
    heading: 45,
    pitch: 0,
    roll: 0
}
//3dtile测试数据
export const model3dtilesTestInfo: ILayerItem = {
    id: LayerIdFlag.MODEL_3DTILES_TEST,
    name: "model3dtilesTest",
    type: "3dtiles",
    url: "/testdata/dayanta/tileset.json",
    layer: "model3dtilesTest"
}

//czml测试数据
export const czmlTestInfo: ILayerItem = {
    id: LayerIdFlag.CZML_TEST,
    name: "czmlTest",
    type: "czml",
    url: "/testdata/simple.czml",
    layer: "czmlTest"
}

// wms测试数据
export const wmsImageTestInfo: ILayerItem = {
    id: LayerIdFlag.WMS_IMAGE_TEST,
    name: "wmsImageTest",
    type: "imagery_wms",
    url: 'http://localhost:8080/geoserver/gongzhonghao/wms',  //用户需调整为自己的geoserver地址
    layer: 'gongzhonghao:tif3',   //用户需调整为自己的图层名称
}
// wms测试数据
export const wmsShpTestInfo: ILayerItem = {
    id: LayerIdFlag.WMS_SHAPETEST,
    name: "wmsShpTest",
    type: "imagery_wms",
    url: 'http://localhost:8080/geoserver/gongzhonghao/wms',  //用户需调整为自己的geoserver地址
    layer: 'gongzhonghao:beijing',   //用户需调整为自己的图层名称
}

// wmts测试数据
export const wmtsImageTestInfo: ILayerItem = {
    id: LayerIdFlag.WMTS_IMAGE_TEST,
    name: "wmtsImageTest",
    type: "imagery_wmts",
    //用户需调整为自己的geoserver地址
    url: 'http://localhost:8080/geoserver/gwc/service/wmts/rest/gongzhonghao:tif3/{style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}?format=image/png',  //用户需调整为自己的geoserver地址
    //用户需调整为自己的图层名称
    layer: 'gongzhonghao:tif3',   //用户需调整为自己的图层名称
    style: 'raster',
    format: 'image/png',  
    tileMatrixLabels: ['EPSG:4326:0', 'EPSG:4326:1', 'EPSG:4326:2',
                        'EPSG:4326:3', 'EPSG:4326:4', 'EPSG:4326:5', 'EPSG:4326:6',
                        'EPSG:4326:7', 'EPSG:4326:8', 'EPSG:4326:9', 'EPSG:4326:10',
                        'EPSG:4326:11', 'EPSG:4326:12', 'EPSG:4326:13', 'EPSG:4326:14',
                        'EPSG:4326:15', 'EPSG:4326:16', 'EPSG:4326:17', 'EPSG:4326:18'],
    tilingScheme: new GeographicTilingScheme({
        numberOfLevelZeroTilesX: 2,
        numberOfLevelZeroTilesY: 1,
    }),
    
}
// xyz测试数据
export const xyzImageTestInfo: ILayerItem = {
    id: LayerIdFlag.XYZ_IMAGE_TEST,
    name: "xyzImageTest",
    type: "imagery_xyz",
    url: '/testdata/xyzTiles/{z}/{x}/{y}.png',  //用户需调整为自己的瓦片地址
    layer: 'xyzImageTest',   //用户需调整为自己的图层名称
}


